load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "srverrors",
    srcs = ["errors.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/server/srverrors",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/util/log",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
    ],
)

go_test(
    name = "srverrors_test",
    srcs = [
        "errors_test.go",
        "main_test.go",
    ],
    deps = [
        ":srverrors",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_stretchr_testify//require",
    ],
)
